<template>
  <div class="zhifu-page">
    <!-- 顶部导航栏 -->
     <!-- 顶部导航栏 -->
     <BaseHeader
      :navs="navs"
      :activeNav="activeNav"
      @nav-change="activeNav = $event"
    />

    <!-- 银行账户信息卡片 -->
    <section class="account-card">
      <h2>希赛网银行账户信息</h2>
      <div class="info-row">
        <div class="info-box">
          <div class="value">户名</div>
          <div class="label">深圳希赛网络科技有限公司</div>
        </div>
        <div class="info-box">
          <div class="value">账号</div>
          <div class="label account-number">
            <span ref="accountText"  @click="copyAccount">4318 9999 1010 0038 35053</span>
          </div>
        </div>
        <div class="info-box">
          <div class="value">开户行</div>
          <div class="label">交通银行股份有限公司长岭分行营业部</div>
        </div>
      </div>
      <el-alert v-if="copySuccess" title="账号已复制到剪贴板" type="success" show-icon :closable="false" class="copy-alert" />
      <div class="desc-box">
        <div class="label">说明</div>
        <div class="desc">通过银行转账的方式把报名费用汇到对公账户上时，开户名称处请填写公司的全称，发票抬头只需写"张三"，而不需要写公司名称。</div>
      </div>
    </section>

    <!-- 底部信息 -->
    <BaseFooter />
  </div>
</template>

<script>
import BaseHeader from '@/components/baseHeader.vue';
import BaseFooter from '@/components/baseFooter.vue';
export default {
  data() {
    return {
      navs: ["首页", "新闻", "题库", "资料", "产教课程"],
      activeNav: "题库",
      navOpen: false,
      showKefu: false,
      copySuccess: false
    }
  },
  components: { BaseHeader, BaseFooter },
  methods: {
    copyAccount() {
      // 兼容性写法
      const el = this.$refs.accountText
      if (window.getSelection && document.createRange) {
        const range = document.createRange()
        range.selectNodeContents(el)
        const sel = window.getSelection()
        sel.removeAllRanges()
        sel.addRange(range)
        try {
          document.execCommand('copy')
          sel.removeAllRanges()
          this.copySuccess = true
          setTimeout(() => { this.copySuccess = false }, 1500)
        } catch (e) {
          this.$message.error('复制失败，请手动复制')
        }
      }
    }
  }
}
</script>

<style scoped>
.zhifu-page {
  min-height: 100vh;
  background:url(@/assets/other/zhifubg.png) no-repeat center;
  background-size:100%;
  background-position-y: 0;
  display: flex;
  flex-direction: column;
}
.user-dropdown {
  margin-left: 20px;
}
.account-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(90,143,255,0.08);
  margin: 48px auto 0 auto;
  padding: 40px 32px 32px 32px;
  min-width: 1200px;
  margin-bottom:100px;
}
.account-card h2 {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 32px;
}
.info-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}
.info-box {
  flex: 1;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 4px 4px 12px 0px rgba(55,115,242,0.04);
  border-radius: 8px;
  border: 1px solid #E5E6EB;
  text-align:left;
}
.label {
  color: #888;
  font-size: 14px;
  margin-bottom: 6px;
}
.value {
  font-size: 16px;
  font-weight: 500;
  margin-bottom:10px;
}
.account-number {
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy-alert {
  margin-bottom: 12px;
}
.desc-box {
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 4px 4px 12px 0px rgba(55,115,242,0.04);
  border-radius: 8px;
  border: 1px solid #E5E6EB;
  text-align:left;
}
.desc {
  color: #444;
  font-size: 15px;
}
.footer {
  background: #5a8fff;
  color: #fff;
  margin-top: 48px;
  padding: 40px 0 0 0;
}
.footer-content {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-col {
  flex: 1;
  min-width: 160px;
  margin-bottom: 24px;
}
.footer-title {
  font-weight: bold;
  margin-bottom: 12px;
}
.footer-link {
  margin-bottom: 8px;
  font-size: 15px;
}
.qrcode-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.qrcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qrcode-placeholder {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
}
.qrcode-label {
  font-size: 13px;
  color: #e6f0ff;
}
.copyright {
  text-align: center;
  color: #e6f0ff;
  font-size: 13px;
  margin-top: 16px;
  padding-bottom: 16px;
}
@media (max-width: 900px) {
  .info-row, .footer-content {
    flex-direction: column;
    gap: 16px;
  }
  .account-card {
    padding: 24px 8px;
  }
}
</style>
